﻿using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace Unis.FMS.Platform.Order.Domain {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "doc_dpt_trip", DisableSyncStructure = true)]
	public partial class DocDptTrip {

		[JsonProperty, Column(Name = "id", DbType = "bigint", IsPrimary = true)]
		public long Id { get; set; }

		[JsonProperty, Column(Name = "actual_create_time", DbType = "datetime")]
		public DateTime ActualCreateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		[JsonProperty, Column(Name = "actual_update_time", DbType = "datetime")]
		public DateTime ActualUpdateTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 分配状态  0New 1Queue 2 Accepted 3 Dispatched
		/// </summary>
		[JsonProperty, Column(Name = "assign_status", DbType = "tinyint")]
		public sbyte AssignStatus { get; set; } = 0;

		/// <summary>
		/// vrm vendor code
		/// </summary>
		[JsonProperty, Column(Name = "carrier_code", StringLength = 50, IsNullable = false)]
		public string CarrierCode { get; set; }

		/// <summary>
		/// vrm vendor name
		/// </summary>
		[JsonProperty, Column(Name = "carrier_name", StringLength = 50, IsNullable = false)]
		public string CarrierName { get; set; }

		/// <summary>
		/// 同行人
		/// </summary>
		[JsonProperty, Column(Name = "companion", StringLength = 200, IsNullable = false)]
		public string Companion { get; set; }

		/// <summary>
		/// 公司
		/// </summary>
		[JsonProperty, Column(Name = "company_id", DbType = "int")]
		public int CompanyId { get; set; } = 0;

		/// <summary>
		/// 结束时间
		/// </summary>
		[JsonProperty, Column(Name = "complete_time", DbType = "datetime")]
		public DateTime CompleteTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "create_user", StringLength = 50, IsNullable = false)]
		public string CreateUser { get; set; }

		/// <summary>
		/// 创建方式 0 manual 1 Auto
		/// </summary>
		[JsonProperty, Column(Name = "create_way", DbType = "tinyint")]
		public sbyte CreateWay { get; set; } = 0;

		/// <summary>
		/// 创建人
		/// </summary>
		[JsonProperty, Column(Name = "created_by", DbType = "int")]
		public int CreatedBy { get; set; } = 0;

		/// <summary>
		/// 创建时间
		/// </summary>
		[JsonProperty, Column(Name = "created_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime CreatedTime { get; set; }

		/// <summary>
		/// dispatch date
		/// </summary>
		[JsonProperty, Column(Name = "dispatch_date", DbType = "datetime")]
		public DateTime DispatchDate { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// driver code
		/// </summary>
		[JsonProperty, Column(Name = "driver_code", StringLength = 50, IsNullable = false)]
		public string DriverCode { get; set; }

		/// <summary>
		/// driver name
		/// </summary>
		[JsonProperty, Column(Name = "driver_name", StringLength = 50, IsNullable = false)]
		public string DriverName { get; set; }

		/// <summary>
		/// destination terminal
		/// </summary>
		[JsonProperty, Column(Name = "dst_terminal", StringLength = 50, IsNullable = false)]
		public string DstTerminal { get; set; }

		[JsonProperty, Column(Name = "equipment_id", IsNullable = false)]
		public string EquipmentId { get; set; }

		/// <summary>
		/// 是否删除（0.正常 1.删除）;0.正常 1.删除
		/// </summary>
		[JsonProperty, Column(Name = "is_del", DbType = "int")]
		public int IsDel { get; set; } = 0;

		/// <summary>
		/// 是否开启离线（0.未开启 1.已开启）
		/// </summary>
		[JsonProperty, Column(Name = "is_offline", DbType = "tinyint")]
		public sbyte IsOffline { get; set; }

		/// <summary>
		/// 最大体积
		/// </summary>
		[JsonProperty, Column(Name = "max_volume", DbType = "decimal(11,2)")]
		public decimal MaxVolume { get; set; }

		/// <summary>
		/// 最大重量
		/// </summary>
		[JsonProperty, Column(Name = "max_weight", DbType = "decimal(11,2)")]
		public decimal MaxWeight { get; set; }

		/// <summary>
		/// note
		/// </summary>
		[JsonProperty, Column(Name = "note", StringLength = 500, IsNullable = false)]
		public string Note { get; set; }

		/// <summary>
		/// 0未排序 1已排序 2可重排
		/// </summary>
		[JsonProperty, Column(Name = "optimize_status", DbType = "tinyint")]
		public sbyte OptimizeStatus { get; set; } = 0;

		/// <summary>
		/// origin terminal
		/// </summary>
		[JsonProperty, Column(Name = "org_terminal", StringLength = 50, IsNullable = false)]
		public string OrgTerminal { get; set; }

		/// <summary>
		/// route id
		/// </summary>
		[JsonProperty, Column(Name = "route_id", StringLength = 50, IsNullable = false)]
		public string RouteId { get; set; }

		/// <summary>
		/// route name
		/// </summary>
		[JsonProperty, Column(Name = "route_name", StringLength = 50, IsNullable = false)]
		public string RouteName { get; set; }

		/// <summary>
		/// 开始时间
		/// </summary>
		[JsonProperty, Column(Name = "start_time", DbType = "datetime")]
		public DateTime StartTime { get; set; } = DateTime.Parse("1970-01-01 00:00:00");

		/// <summary>
		/// 状态：0New
		/// </summary>
		[JsonProperty, Column(Name = "status", DbType = "tinyint")]
		public sbyte Status { get; set; } = 1;

		/// <summary>
		/// 总里程
		/// </summary>
		[JsonProperty, Column(Name = "total_miles")]
		public decimal TotalMiles { get; set; } = 0.00M;

		/// <summary>
		/// tractor
		/// </summary>
		[JsonProperty, Column(Name = "tractor", StringLength = 50, IsNullable = false)]
		public string Tractor { get; set; }

		/// <summary>
		/// trailer
		/// </summary>
		[JsonProperty, Column(Name = "trailer", StringLength = 50, IsNullable = false)]
		public string Trailer { get; set; }

		/// <summary>
		/// trip no
		/// </summary>
		[JsonProperty, Column(Name = "trip_no", DbType = "bigint")]
		public long TripNo { get; set; } = 0;

		/// <summary>
		/// trip类型。0:local 1:linehaul 2:other
		/// </summary>
		[JsonProperty, Column(Name = "trip_type", DbType = "tinyint")]
		public sbyte TripType { get; set; }

		/// <summary>
		/// 更新人
		/// </summary>
		[JsonProperty, Column(Name = "update_by", DbType = "int")]
		public int UpdateBy { get; set; } = 0;

		/// <summary>
		/// 更新时间
		/// </summary>
		[JsonProperty, Column(Name = "update_time", DbType = "datetime", InsertValueSql = "CURRENT_TIMESTAMP")]
		public DateTime UpdateTime { get; set; }

		/// <summary>
		/// 修改人
		/// </summary>
		[JsonProperty, Column(Name = "update_user", StringLength = 50, IsNullable = false)]
		public string UpdateUser { get; set; }

	}

}
